<!DOCTYPE html>
<html class="no-js">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>org.jetbrains.kotlinx.mcp.server</title>
    <link href="../../images/logo-icon.svg" rel="icon" type="image/svg">
    <script>var pathToRoot = "../../";</script>
    <script>document.documentElement.classList.replace("no-js","js");</script>
    <script>const storage = localStorage.getItem("dokka-dark-mode")
    if (storage == null) {
        const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
        if (osDarkSchemePreferred === true) {
            document.getElementsByTagName("html")[0].classList.add("theme-dark")
        }
    } else {
        const savedDarkMode = JSON.parse(storage)
        if(savedDarkMode === true) {
            document.getElementsByTagName("html")[0].classList.add("theme-dark")
        }
    }
    </script>
<script type="text/javascript" src="https://unpkg.com/kotlin-playground@1/dist/playground.min.js" async="async"></script>
<script type="text/javascript" src="../../scripts/sourceset_dependencies.js" async="async"></script>
<link href="../../styles/style.css" rel="Stylesheet">
<link href="../../styles/main.css" rel="Stylesheet">
<link href="../../styles/prism.css" rel="Stylesheet">
<link href="../../styles/logo-styles.css" rel="Stylesheet">
<link href="../../styles/font-jb-sans-auto.css" rel="Stylesheet">
<link href="../../ui-kit/ui-kit.min.css" rel="Stylesheet">
<script type="text/javascript" src="../../scripts/clipboard.js" async="async"></script>
<script type="text/javascript" src="../../scripts/navigation-loader.js" async="async"></script>
<script type="text/javascript" src="../../scripts/platform-content-handler.js" async="async"></script>
<script type="text/javascript" src="../../scripts/main.js" defer="defer"></script>
<script type="text/javascript" src="../../scripts/prism.js" async="async"></script>
<script type="text/javascript" src="../../ui-kit/ui-kit.min.js" async="async"></script>
<script type="text/javascript" src="../../scripts/symbol-parameters-wrapper_deferred.js" defer="defer"></script>
</head>
<body>
    <div class="root">
<nav class="navigation" id="navigation-wrapper">
    <div class="navigation--inner">
        <div class="navigation-title">
            <button class="menu-toggle" id="menu-toggle" type="button">toggle menu</button>
            <div class="library-name">
                    <a class="library-name--link" href="../../index.html">
                            MCP Kotlin SDK
                    </a>
            </div>
            <div class="library-version">
1.0-SNAPSHOT            </div>
        </div>
        <div class="filter-section" id="filter-section">
                <button class="platform-tag platform-selector jvm-like" data-active="" data-filter=":/main">jvm</button>
        </div>
    </div>
    <div class="navigation-controls">
        <button class="navigation-controls--btn navigation-controls--theme" id="theme-toggle-button" type="button">switch theme</button>
        <div class="navigation-controls--btn navigation-controls--search" id="searchBar" role="button">search in API</div>
    </div>
</nav>
        <div id="container">
            <div class="sidebar" id="leftColumn">
                <div class="sidebar--inner" id="sideMenu"></div>
            </div>
            <div id="main">
<div class="main-content" data-page-type="package" id="content" pageIds="MCP Kotlin SDK::org.jetbrains.kotlinx.mcp.server////PointingToDeclaration//-251573632">
  <div class="breadcrumbs"><a href="../../index.html">MCP Kotlin SDK</a><span class="delimiter">/</span><span class="current">org.jetbrains.kotlinx.mcp.server</span></div>
  <div class="cover ">
    <h1 class="cover"><span><span>Package-level</span></span> <span><span>declarations</span></span></h1>
  </div>
  <div class="tabbedcontent">
    <div class="tabs-section" tabs-section="tabs-section"><button class="section-tab" data-active="" data-togglable="TYPE">Types</button><button class="section-tab" data-togglable="FUNCTION,EXTENSION_FUNCTION">Functions</button></div>
    <div class="tabs-section-body">
      <div data-togglable="TYPE">
        <h2 class="">Types</h2>
        <div class="table"><a data-name="1451107180%2FClasslikes%2F-251573632" anchor-label="RegisteredPrompt" id="1451107180%2FClasslikes%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-registered-prompt/index.html"><span>Registered</span><wbr></wbr><span><span>Prompt</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1451107180%2FClasslikes%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">data </span><span class="token keyword">class </span><a href="-registered-prompt/index.html">RegisteredPrompt</a><span class="token punctuation">(</span><span class="parameters "><span class="parameter "><span class="token keyword">val </span>prompt<span class="token operator">: </span><a href="../org.jetbrains.kotlinx.mcp/-prompt/index.html">Prompt</a><span class="token punctuation">, </span></span><span class="parameter "><span class="token keyword">val </span>messageProvider<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><a href="../org.jetbrains.kotlinx.mcp/-get-prompt-request/index.html">GetPromptRequest</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="../org.jetbrains.kotlinx.mcp/-get-prompt-result/index.html">GetPromptResult</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">A wrapper class representing a registered prompt on the server.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-1191370686%2FClasslikes%2F-251573632" anchor-label="RegisteredResource" id="-1191370686%2FClasslikes%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-registered-resource/index.html"><span>Registered</span><wbr></wbr><span><span>Resource</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1191370686%2FClasslikes%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">data </span><span class="token keyword">class </span><a href="-registered-resource/index.html">RegisteredResource</a><span class="token punctuation">(</span><span class="parameters "><span class="parameter "><span class="token keyword">val </span>resource<span class="token operator">: </span><a href="../org.jetbrains.kotlinx.mcp/-resource/index.html">Resource</a><span class="token punctuation">, </span></span><span class="parameter "><span class="token keyword">val </span>readHandler<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><a href="../org.jetbrains.kotlinx.mcp/-read-resource-request/index.html">ReadResourceRequest</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="../org.jetbrains.kotlinx.mcp/-read-resource-result/index.html">ReadResourceResult</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">A wrapper class representing a registered resource on the server.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-183307912%2FClasslikes%2F-251573632" anchor-label="RegisteredTool" id="-183307912%2FClasslikes%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-registered-tool/index.html"><span>Registered</span><wbr></wbr><span><span>Tool</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-183307912%2FClasslikes%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">data </span><span class="token keyword">class </span><a href="-registered-tool/index.html">RegisteredTool</a><span class="token punctuation">(</span><span class="parameters "><span class="parameter "><span class="token keyword">val </span>tool<span class="token operator">: </span><a href="../org.jetbrains.kotlinx.mcp/-tool/index.html">Tool</a><span class="token punctuation">, </span></span><span class="parameter "><span class="token keyword">val </span>handler<span class="token operator">: </span><span class="token keyword">suspend </span><span class="token punctuation">(</span><a href="../org.jetbrains.kotlinx.mcp/-call-tool-request/index.html">CallToolRequest</a><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="../org.jetbrains.kotlinx.mcp/-call-tool-result/index.html">CallToolResult</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">A wrapper class representing a registered tool on the server.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="1418128015%2FClasslikes%2F-251573632" anchor-label="Server" id="1418128015%2FClasslikes%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-server/index.html"><span><span>Server</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1418128015%2FClasslikes%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">class </span><a href="-server/index.html">Server</a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">serverInfo<span class="token operator">: </span><a href="../org.jetbrains.kotlinx.mcp/-implementation/index.html">Implementation</a><span class="token punctuation">, </span></span><span class="parameter ">options<span class="token operator">: </span><a href="-server-options/index.html">ServerOptions</a><span class="token punctuation">, </span></span><span class="parameter "><span class="token keyword">var </span>onCloseCallback<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator">?</span><span class="token operator"> = </span>null</span></span><span class="token punctuation">)</span> : <a href="../org.jetbrains.kotlinx.mcp.shared/-protocol/index.html">Protocol</a><span class="token operator">&lt;</span><a href="../org.jetbrains.kotlinx.mcp/-server-request/index.html">ServerRequest</a><span class="token punctuation">, </span><a href="../org.jetbrains.kotlinx.mcp/-server-notification/index.html">ServerNotification</a><span class="token punctuation">, </span><a href="../org.jetbrains.kotlinx.mcp/-server-result/index.html">ServerResult</a><span class="token operator">&gt; </span></div><div class="brief "><p class="paragraph">An MCP server on top of a pluggable transport.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-951892139%2FClasslikes%2F-251573632" anchor-label="ServerOptions" id="-951892139%2FClasslikes%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-server-options/index.html"><span>Server</span><wbr></wbr><span><span>Options</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-951892139%2FClasslikes%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">class </span><a href="-server-options/index.html">ServerOptions</a><span class="token punctuation">(</span><span class="parameters "><span class="parameter "><span class="token keyword">val </span>capabilities<span class="token operator">: </span><a href="../org.jetbrains.kotlinx.mcp/-server-capabilities/index.html">ServerCapabilities</a><span class="token punctuation">, </span></span><span class="parameter "><span class="token keyword">var </span>enforceStrictCapabilities<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a><span class="token operator"> = </span><span class="token boolean">true</span></span></span><span class="token punctuation">)</span> : <a href="../org.jetbrains.kotlinx.mcp.shared/-protocol-options/index.html">ProtocolOptions</a></div><div class="brief "><p class="paragraph">Configuration options for the MCP server.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="123791281%2FClasslikes%2F-251573632" anchor-label="SSEServerTransport" id="123791281%2FClasslikes%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-s-s-e-server-transport/index.html"><span>SSEServer</span><wbr></wbr><span><span>Transport</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="123791281%2FClasslikes%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">class </span><a href="-s-s-e-server-transport/index.html">SSEServerTransport</a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">endpoint<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">session<span class="token operator">: </span><span data-unresolved-link="io.ktor.server.sse/ServerSSESession///PointingToDeclaration/">ServerSSESession</span></span></span><span class="token punctuation">)</span> : <a href="../org.jetbrains.kotlinx.mcp.shared/-transport/index.html">Transport</a></div><div class="brief "><p class="paragraph">Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="315423733%2FClasslikes%2F-251573632" anchor-label="StdioServerTransport" id="315423733%2FClasslikes%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-stdio-server-transport/index.html"><span>Stdio</span><wbr></wbr><span>Server</span><wbr></wbr><span><span>Transport</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="315423733%2FClasslikes%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">class </span><a href="-stdio-server-transport/index.html">StdioServerTransport</a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">inputStream<span class="token operator">: </span><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/BufferedInputStream.html">BufferedInputStream</a><span class="token operator"> = </span>BufferedInputStream(System.`in`)<span class="token punctuation">, </span></span><span class="parameter ">outputStream<span class="token operator">: </span><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/PrintStream.html">PrintStream</a><span class="token operator"> = </span>System.out</span></span><span class="token punctuation">)</span> : <a href="../org.jetbrains.kotlinx.mcp.shared/-transport/index.html">Transport</a></div><div class="brief "><p class="paragraph">A server transport that communicates with a client via standard I/O.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="1831430013%2FClasslikes%2F-251573632" anchor-label="WebSocketMcpServerTransport" id="1831430013%2FClasslikes%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-web-socket-mcp-server-transport/index.html"><span>Web</span><wbr></wbr><span>Socket</span><wbr></wbr><span>Mcp</span><wbr></wbr><span>Server</span><wbr></wbr><span><span>Transport</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1831430013%2FClasslikes%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">class </span><a href="-web-socket-mcp-server-transport/index.html">WebSocketMcpServerTransport</a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">session<span class="token operator">: </span><span data-unresolved-link="io.ktor.server.websocket/WebSocketServerSession///PointingToDeclaration/">WebSocketServerSession</span></span></span><span class="token punctuation">)</span> : <a href="../org.jetbrains.kotlinx.mcp.shared/-web-socket-mcp-transport/index.html">WebSocketMcpTransport</a></div><div class="brief "><p class="paragraph">Server-side implementation of the MCP (Model Context Protocol) transport over WebSocket.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div data-togglable="EXTENSION_FUNCTION">
        <h2 class="">Functions</h2>
        <div class="table"><a data-name="-437318750%2FFunctions%2F-251573632" anchor-label="MCP" id="-437318750%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="-m-c-p.html"><span><span>MCP</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-437318750%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">fun </span><span data-unresolved-link="io.ktor.server.application/Application///PointingToDeclaration/">Application</span><span class="token punctuation">.</span><a href="-m-c-p.html"><span class="token function">MCP</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">block<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="-server/index.html">Server</a></span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Configures the Ktor Application to handle Model Context Protocol (MCP) over Server-Sent Events (SSE).</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="-821324639%2FFunctions%2F-251573632" anchor-label="mcpWebSocket" id="-821324639%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="mcp-web-socket.html"><span>mcp</span><wbr></wbr><span>Web</span><wbr></wbr><span><span>Socket</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-821324639%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">fun </span><span data-unresolved-link="io.ktor.server.routing/Route///PointingToDeclaration/">Route</span><span class="token punctuation">.</span><a href="mcp-web-socket.html"><span class="token function">mcpWebSocket</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">options<span class="token operator">: </span><a href="-server-options/index.html">ServerOptions</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span></span><span class="parameter ">handler<span class="token operator">: </span><span class="token keyword">suspend </span><a href="-server/index.html">Server</a><span class="token punctuation">.</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator"> = </span>{}</span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Registers a WebSocket route that establishes an MCP (Model Context Protocol) server session.</p></div><div class="symbol monospace"><span class="token keyword">fun </span><span data-unresolved-link="io.ktor.server.routing/Route///PointingToDeclaration/">Route</span><span class="token punctuation">.</span><a href="mcp-web-socket.html"><span class="token function">mcpWebSocket</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">path<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">options<span class="token operator">: </span><a href="-server-options/index.html">ServerOptions</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span></span><span class="parameter ">handler<span class="token operator">: </span><span class="token keyword">suspend </span><a href="-server/index.html">Server</a><span class="token punctuation">.</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator"> = </span>{}</span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Registers a WebSocket route at the specified <a href="mcp-web-socket.html">path</a> that establishes an MCP server session.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
<a data-name="500963803%2FFunctions%2F-251573632" anchor-label="mcpWebSocketTransport" id="500963803%2FFunctions%2F-251573632" data-filterable-set=":/main"></a>
          <div class="table-row" data-filterable-current=":/main" data-filterable-set=":/main">
            <div class="main-subrow keyValue ">
              <div class=""><span class="inline-flex">
                  <div><a href="mcp-web-socket-transport.html"><span>mcp</span><wbr></wbr><span>Web</span><wbr></wbr><span>Socket</span><wbr></wbr><span><span>Transport</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="500963803%2FFunctions%2F-251573632"></span>
                    <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                  </span></span></div>
              <div>
                <div class="title">
                  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":/main"><div class="symbol monospace"><span class="token keyword">fun </span><span data-unresolved-link="io.ktor.server.routing/Route///PointingToDeclaration/">Route</span><span class="token punctuation">.</span><a href="mcp-web-socket-transport.html"><span class="token function">mcpWebSocketTransport</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">handler<span class="token operator">: </span><span class="token keyword">suspend </span><a href="-web-socket-mcp-server-transport/index.html">WebSocketMcpServerTransport</a><span class="token punctuation">.</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator"> = </span>{}</span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Registers a WebSocket route that creates an MCP server transport layer.</p></div><div class="symbol monospace"><span class="token keyword">fun </span><span data-unresolved-link="io.ktor.server.routing/Route///PointingToDeclaration/">Route</span><span class="token punctuation">.</span><a href="mcp-web-socket-transport.html"><span class="token function">mcpWebSocketTransport</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">path<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">handler<span class="token operator">: </span><span class="token keyword">suspend </span><a href="-web-socket-mcp-server-transport/index.html">WebSocketMcpServerTransport</a><span class="token punctuation">.</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator"> = </span>{}</span></span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Registers a WebSocket route at the specified <a href="mcp-web-socket-transport.html">path</a> that creates an MCP server transport layer.</p></div></div></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
    <div class="footer">
        <a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>
        <span>© 2024 Copyright</span>
        <span class="pull-right">
            <span>Generated by </span>
            <a class="footer--link footer--link_external" href="https://github.com/Kotlin/dokka">
                <span>dokka</span>
            </a>
        </span>
    </div>
            </div>
        </div>
    </div>
</body>
</html>